from math import log10

fCurr = 1
fPrev = 1
fTerm = 2

limit = 1000 - 1

while log10(fCurr) < limit:
    next = fPrev + fCurr
    fPrev = fCurr
    fCurr = next
    fTerm += 1
    
print fTerm